package com.java.demo.model;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: lishuo
 * Date: 2023-09-02
 * Time: 10:22
 */
@Component
public class Users {
    @Bean("user")
    @Scope("prototype") // 设置原型作用域
    public User user(){
        User user = new User();
        user.setName("这是初始数据");
        return user;
    }
//    @Bean("user2")
//    public User user2(){
//        User user = new User();
//        user.setName("李四");
//        return user;
//    }
}
